window.onload = () => {
  document.querySelector("#img").style.width = "100px";
  document.querySelector("#img").style.height = "100px";
  document.querySelector("#img").style.transform = "translateX(100%)";
  document.querySelector("#img").style.transition = ".3s";
  document.querySelector("#img").style.display = "none";
  document.querySelector("#flie").addEventListener("change", async function () {
    let res = await uploadAjax({
      url: "http://172.16.8.193:4000/students/uploadImages",
      file: this.files,
    });
    let { data } = res;
    document.querySelector("#img").setAttribute("src", data);
    document.querySelector("#img").style.display = "block";
    setTimeout(function () {
      document.querySelector("#img").style.transform = "translateX(0%)";
      document.querySelector("#img").style.transition = "1s";
    }, 200);
  });
};
